package com.baidu.tcpThreadPoolDemo1;

import java.io.OutputStream;
import java.io.PrintStream;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.Scanner;

public class Client {
    public static void main(String[] args) throws Exception {
        Socket socket = new Socket(InetAddress.getLocalHost().getHostAddress(), 9090);

        OutputStream outputStream = socket.getOutputStream();

        PrintStream printStream = new PrintStream(outputStream);

        Scanner scanner = new Scanner(System.in);

        String msg;
        while (true){
            System.out.println("请输入");
            msg = scanner.next();

            printStream.println(msg);
        }
    }
}
